﻿using Abp.Configuration.Startup;
using AppFramework.App.Client.ApiClient.Models;
using AppFramework.App.Client.ApiClient;
using AppFramework.App.Client.Authorization.Accounts;
using AppFramework.App.Client.Authorization.Permissions;
using AppFramework.App.Client.Authorization.Roles;
using AppFramework.App.Client.Authorization.Users.Delegation;
using AppFramework.App.Client.Authorization.Users.Profile;
using AppFramework.App.Client.Authorization.Users;
using AppFramework.App.Client.Caching;
using AppFramework.App.Client.Chat;
using AppFramework.App.Client.Common;
using AppFramework.App.Client.Configuration;
using AppFramework.App.Client.Demo;
using AppFramework.App.Client.DynamicEntityProperties;
using AppFramework.App.Client.Edition;
using AppFramework.App.Client.Friendships;
using AppFramework.App.Client.Localization;
using AppFramework.App.Client.MultiTenancy.HostDashboard;
using AppFramework.App.Client.MultiTenancy;
using AppFramework.App.Client.Notifications;
using AppFramework.App.Client.Organizations;
using AppFramework.App.Client.Sessions;
using AppFramework.App.Client.Tenants.Dashboard;
using AppFramework.App.Client.Version;
using AppFramework.App.Shared.Auditing;
using AppFramework.App.Shared.Authorization.Accounts;
using AppFramework.App.Shared.Authorization.Permissions;
using AppFramework.App.Shared.Authorization.Roles;
using AppFramework.App.Shared.Authorization.Users.Delegation;
using AppFramework.App.Shared.Authorization.Users.Profile;
using AppFramework.App.Shared.Authorization.Users;
using AppFramework.App.Shared.Caching;
using AppFramework.App.Shared.Chat;
using AppFramework.App.Shared.Common;
using AppFramework.App.Shared.Configuration.Host;
using AppFramework.App.Shared.Demo;
using AppFramework.App.Shared.DynamicEntityProperties;
using AppFramework.App.Shared.Editions;
using AppFramework.App.Shared.Friendships;
using AppFramework.App.Shared.Localization;
using AppFramework.App.Shared.MultiTenancy.HostDashboard;
using AppFramework.App.Shared.MultiTenancy;
using AppFramework.App.Shared.Notifications;
using AppFramework.App.Shared.Organizations;
using AppFramework.App.Shared.Sessions;
using AppFramework.App.Shared.Tenants.Dashboard;
using AppFramework.App.Shared.Version;
using AppFramework.Shared.Services.Chat;
using AppFramework.Shared.Services.Datapager;
using AppFramework.Shared.Validations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AppFramework.App.Client.Auditing;

namespace AppFramework.Shared
{
    public static class SharedModuleExtensions
    {
        public static void AddSharedServices(this IContainerRegistry services)
        {
            services.RegisterSingleton<IGlobalValidator, GlobalValidator>();
            services.Register<IDataPagerService, DataPagerService>();
            services.RegisterSingleton<IChatService, ChatService>();


            services.RegisterSingleton<IAccessTokenManager, AccessTokenManager>();
            services.RegisterSingleton<IMultiTenancyConfig, MultiTenancyConfig>();
            services.RegisterSingleton<IApplicationContext, ApplicationContext>();
            services.RegisterSingleton<AbpApiClient>();
            services.RegisterSingleton<AbpAuthenticateModel>();
            services.RegisterSingleton<UserConfigurationService>();
            services.RegisterScoped<ProxyChatControllerService>();
            services.RegisterScoped<ProxyProfileControllerService>();
            services.RegisterScoped<ProxyTokenAuthControllerService>();

            services.RegisterScoped<IFriendshipAppService, FriendshipAppService>();
            services.RegisterScoped<IChatAppService, ChatAppService>();
            services.RegisterScoped<IRoleAppService, RoleAppService>();
            services.RegisterScoped<IUserAppService, ProxyUserAppService>();
            services.RegisterScoped<IUserLoginAppService, UserLoginAppService>();
            services.RegisterScoped<IUserDelegationAppService, UserDelegationAppService>();
            services.RegisterScoped<ITenantAppService, ProxyTenantAppService>();
            services.RegisterScoped<IEditionAppService, EditionAppService>();
            services.RegisterScoped<IAuditLogAppService, AuditLogAppService>();
            services.RegisterScoped<ILanguageAppService, LanguageAppService>();

            services.RegisterScoped<INotificationAppService, NotificationAppService>();
            services.RegisterScoped<IOrganizationUnitAppService, OrganizationUnitAppService>();
            services.RegisterScoped<IDynamicPropertyAppService, DynamicPropertyAppService>();
            services.RegisterScoped<ICachingAppService, CachingAppService>();
            services.RegisterScoped<ITenantDashboardAppService, TenantDashboardAppService>();
            services.RegisterScoped<IDynamicEntityPropertyAppService, DynamicEntityPropertyAppService>();
            services.RegisterScoped<IDynamicEntityPropertyDefinitionAppService, DynamicEntityPropertyDefinitionAppService>();
            services.RegisterScoped<IDynamicPropertyValueAppService, DynamicPropertyValueAppService>();
            services.RegisterScoped<ICommonLookupAppService, ProxyCommonLookupAppService>();
            services.RegisterScoped<IAccountAppService, ProxyAccountAppService>();
            services.RegisterScoped<IProfileAppService, ProxyProfileAppService>();
            services.RegisterScoped<ISessionAppService, ProxySessionAppService>();
            services.RegisterScoped<IHostDashboardAppService, HostDashboardAppService>();
            services.RegisterScoped<IHostSettingsAppService, HostSettingsAppService>();
            services.RegisterScoped<IPermissionAppService, PermissionAppService>();

            services.RegisterScoped<IUserLinkAppService, UserLinkAppService>();
            services.RegisterScoped<IAbpVersionsAppService, AbpVersionsAppService>();
            services.RegisterScoped<IAbpDemoAppService, AbpDemoAppService>();


        }


    }
}
